#include <iostream>
#include<ostream>
using std::endl;
using std::cout;
using std::cin;
using std::ostream;
class Line{
public:
    class Point{
        public:
            Point(int x,int y)
                :_x(x)
                ,_y(y){
                    cout<<"Point"<<endl;
                 }
            void gets(){
                cout<<"("<<_x<<","<<_y<<")";
            }
        friend
            ostream & operator<<(ostream &os,const Point &po);
        private:
            int _x;
            int _y;
    };
public:
    Line(int x,int y,int x1,int y1)
        :_p1(x,y)
        ,_p2(x1,y1)
    {
        cout<<"Line"<<endl;
    }
    void gets(){
        _p1.gets();cout<<"------->";_p2.gets();
        cout<<endl;
    }
    friend
   ostream& operator<<(ostream &os,const Line &li);
private:
    Point _p1;
    Point _p2;


};

ostream & operator<<(ostream &os,const Line::Point &po){
    os<<"("<<po._x<<","<<po._y<<")";
    return os;
}
//必须要是 友元函数
ostream& operator<<(ostream &os,const Line&le){
    os<<le._p1<<"---->"<<le._p2;
    return os;
}
void test0(){
    Line line(2,3,4,5);
    //想要实现
    cout<<line<<endl;

    return;

}
int main()
{
    /* Line::Point pp(1,3); */
    /* pp.gets(); */
    /* Line line(3,4,5,6); */
    /* line.gets(); */
    test0();
    std::cout << "Hello world" << std::endl;
    return 0;
}

